resetPasswdController = BaseController.extend({
	template:'resetPasswd',
	center:'修改密码',
	mainView: 'resetPasswd',
	headerTransparent:false,
	waitOn:function(){
		//Meteor.subscribe('parters',{passwd: 123456});
	},
	onRendered:function(self){
		var myApp = new Framework7({
			modalTitle: "提示",
		});
		var $$ = Dom7;
		$$('.form-to-data').on('click', function(){
  			var formData = myApp.formToData('#new-passwd');
  			//需要验证输入密码是否正确
  			if (formData.oldPasswd !== '1234')
  			{
  				console.log(formData.oldPasswd);
  				myApp.alert('密码输入错误，请重新输入');
  				$("#oldPasswd").val('');
  				$("#newPasswd").val('');
  				$("#repeat").val('');
  			}else if (formData.newPasswd !== formData.repeat){
  				myApp.alert('两次输入的新密码不一致，请重新输入');
  				$("#newPasswd").val('');
  				$("#repeat").val('');
  			}else {
  			//把新密码插入到parter表中
  				var parter = {
  					'name': 'kitty2',
  					'passwd': formData.newPasswd,
  				};
  				Partners.insert(parter);
  				myApp.alert('密码修改成功', function(){
					Router.go('setAccount');
				});
  			}

		});
	},
	data:function(){
		return{
			//parter1:Parters.findOne(),
		}
	},
})
